package org.ueg.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cascade;

@Entity
public class Assento implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long idAssento;
	
	@Column(name="numeroAssento")
	private Integer numeroAssento;
	
	@Column(name="preco")
	private Double preco;
	
		
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="idReserva")
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	private Reserva reserv;
	
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="idVoo")
	//@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	private Voo voo2;
	
	
	
	
	
	
	
	
	public Voo getVoo2() {
		return voo2;
	}
	public void setVoo2(Voo voo2) {
		this.voo2 = voo2;
	}
	public Reserva getReserv() {
		return reserv;
	}
	public void setReserv(Reserva reserv) {
		this.reserv = reserv;
	}
	public Long getIdAssento() {
		return idAssento;
	}
	public void setIdAssento(Long idAssento) {
		this.idAssento = idAssento;
	}
	public Integer getNumeroAssento() {
		return numeroAssento;
	}
	public void setNumeroAssento(Integer numeroAssento) {
		this.numeroAssento = numeroAssento;
	}
	public Double getPreco() {
		return preco;
	}
	public void setPreco(Double preco) {
		this.preco = preco;
	}
	

}
